﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace snat.EventFramework.Errors
{
    
  //  public delegate int ErrorHandler(object source, ErrorArgs arguments);

    public enum severity
    {
        Informational,
        Minor,
        Major,
        Severe
    }

    public class ErrorArgs : EventArgs
    {
        public string Title { get; private set; }
        public string Message { get; private set; }
        public severity Severity { get; private set; }
        public Exception Cause { get; private set; }

        public ErrorArgs(Exception _cause) {
            Cause = _cause;
            Title = "Error in " + Cause.Source;
            Message = Cause.Message;
            Severity = severity.Severe; //because you shouldn't have been lazy and used this constructor
        }

        public ErrorArgs(string _title, string _message, severity _severity, Exception _cause = null) {
            Title = _title;
            Message = _message;
            Severity = _severity;
            Cause = _cause;
        }
    }
}


